load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "slstorage",
    srcs = [
        "key_encoder.go",
        "metrics.go",
        "sessionid.go",
        "sessionid_fuzz.go",
        "slstorage.go",
        "test_helpers.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/sqlliveness/slstorage",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/multitenant",
        "//pkg/roachpb",
        "//pkg/server/settingswatcher",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/systemschema",
        "//pkg/sql/enum",
        "//pkg/sql/regionliveness",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sqlliveness",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/cache",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/syncutil/singleflight",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_prometheus_client_model//go",
        "@com_github_stretchr_testify//require",
    ],
)

go_test(
    name = "slstorage_test",
    size = "medium",
    srcs = [
        "key_encoder_test.go",
        "main_test.go",
        "sessionid_test.go",
        "slstorage_internal_test.go",
        "slstorage_test.go",
    ],
    embed = [":slstorage"],
    deps = [
        "//pkg/base",
        "//pkg/clusterversion",
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/server/settingswatcher",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/catalog/systemschema",
        "//pkg/sql/enum",
        "//pkg/sql/sqlliveness",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@org_golang_x_sync//errgroup",
    ],
)
